
; You may customize this and other start-up templates; 
; The location of this template is c:\emu8086\inc\0_com_template.txt

org 100h 

MOV AX, 0B00H
MOV DS, AX
MOV AH, 00H

MOV AL, 0AH
MOV [SI], AL   ; N
MOV AL, 00H
MOV [SI+1], AL ; T
MOV AL, 00H
MOV [SI+2], AL ; T'
MOV AL, 00H
MOV [SI+3], AL ; T2
MOV AL, 01H
MOV [SI+4], AL ; 1
MOV AL, 80H
MOV [SI+5], AL ; 80H
MOV AL, 0FFH
MOV [SI+6], AL ; FFH 

MOV AL, [SI]
XOR AL, [SI+6]
ADD AL, [SI+4]
MOV [SI], AL

START: MOV AL, [SI+3]
       ADD AL, [SI]
       JZ  SKZ0
       JNZ SKZ1
       SKZ0: JZ GOOD
       SKZ1: AND AL, [SI+5]
       JNZ CONTINUE
       JZ  BAD
       GOOD: MOV DH, [SI+2]
             MOV DL, DH
             HLT
       BAD: MOV DH, [SI+1]
            MOV DL, [SI+2]
            HLT
       CONTINUE: MOV AL, [SI+2]
                 MOV [SI+1], AL
                 ADD AL, [SI+4]
                 MOV [SI+2], AL
                 MOV AL, [SI+3]
                 ADD AL, [SI+1]
                 ADD AL, [SI+1]
                 ADD AL, [SI+4]
                 MOV [SI+3], AL
                 JNZ START

ret




